#pragma once
#include <iostream>
#include <assert.h>
#include "LinkedList.h"
#include <stack>

using namespace std;


class Queue
{ 
  public:
      Queue() {};
      void Enqueue(City x){q.insertTail(x);};
	  City peekHead() {assert(size()>0); return q.getHead()->data;};
	  City peekTail() {assert(size()>0); return q.getTail()->data;};

      City Dequeue() {
		  assert(size()>0);
		  City x=peekHead();
		  q.removeHead();
		  return x;
	  };

	  void reverse() {
		  stack<City> city;
		  int s = size();
		  for (int i = 0; i < s; i++)
			  city.push(Dequeue());
		  for (int i = 0; i < s; i++)
		  {
			  Enqueue(city.top());
			  city.pop();
		  }
	  }
      int size() {return q.size();};
      bool isEmpty() {return q.isEmpty();};
	 
  private:
     list q;
 };